#include "my_define.h"
#include <stdarg.h> 
#include <stdio.h>   
#include "../../Core/Inc/usart.h"

machine_t machine = {
    .state = STATE_RUNNING,
	.ds18b20_threshold = 50,
    .Kcouple_threshold = 50,
    .pt100_threshold = 50,
};


void safe_printf(const char *fmt, ...) {
    static char buffer[512];

    va_list args;
    va_start(args, fmt);
    vsnprintf(buffer, sizeof(buffer), fmt, args);
    va_end(args);

    //HAL_UART_Transmit_IT(&huart1, (uint8_t*)buffer, strlen(buffer));
		HAL_UART_Transmit(&huart1, (uint8_t*)buffer, strlen(buffer), 0xFFFF);
}